Release 10.1A: OpenEdge Development:
Messaging and ESB


Reply mechanisms

This section applies to both the Pub/Sub and the PTP domains.

Java-JMS provides no built-in mechanism for replies. It is the responsibility of the application to:

The receiver must extract the reply destination from the message and follow the normal publish (or send) steps to reply.

The 4GL-JMS API simplifies this process, both for the sender needing a reply and for the receiver needing to reply:

An application can also publish a reply message or send it to a queue by first calling the getReplyToDestinationType function to extract the name of the reply destination, and then calling the publish procedure or sendToQueue procedure directly.

Note: If the ReplyTo destination is a temporary destination, an application must send a reply before deleting the original message. (See the Java Message Service specification and SonicMQ Programming Guide for information on temporary destinations.) Deleting the original message tells the 4GL-JMS implementation that the ReplyTo temporary destination will no longer be used.

By default, the type of the ReplyTo destination matches the type of the origin of the message:

However, it is legal to designate a queue for replying to a published message, or a topic for replying to messages received from a queue. To accommodate this, the 4GL-JMS API supports the setReplyToDestinationType procedure and the getReplyToDestinationType function, both of which support the CHARACTER values topic and queue.

The setReplyToDestinationType procedure must be called if the 4GL application calls the setJMSReplyTo procedure and sets a destination from a domain other than that of the session. The getReplyToDestinationType function must be called when the 4GL application receives a message and wants to reply to it, but is not certain about the ReplyTo domain.

Using a second session for replying

In some cases the 4GL application might need to reply through a different session from the one that receives the original message. For example, the publisher of the message might want to designate a queue, rather than a topic, for receiving the replies. In such a case, the publisher sets the JMSReplyTo header field to the name of the queue and then publishes the message. The receiver receives the message through a Pub/Sub session, extracts the queue from the JMSReplyTo header field, and uses a PTP Session object to send the reply to that queue. The original publisher then uses a Pub/Sub Session object to receive the reply.

The 4GL-JMS API supports such transactions with these limitations:


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095